Skip to content

[Windows] Utilize Nette\Utils\FileSystem instead of Symfony\Component\Filesystem\Filesystem to write file - #5514

Merged
samsonasik merged 10 commits into
mainfrom
windows-write
Jan 28, 2024
Merged

[Windows] Utilize Nette\Utils\FileSystem instead of Symfony\Component\Filesystem\Filesystem to write file#5514
samsonasik merged 10 commits into
mainfrom
windows-write

Conversation

@samsonasik

@samsonasik samsonasik commented Jan 28, 2024

Copy link
Copy Markdown
Member

The Nette\Utils\FileSystem::write() is using file_put_contents() instead of rename() which has bug on php itself, ref:

that used by symfony.

This should fix rectorphp/rector#8432

/cc @stein197

using null arg to keep file permission:

-        $this->filesystem->dumpFile($filePath, $newContent);
+        FileSystem::write($filePath, $newContent, null);

@samsonasik

Copy link
Copy Markdown
Member Author

All checks have passed 🎉 @TomasVotruba I think it is ready.

@samsonasik

Copy link
Copy Markdown
Member Author

@TomasVotruba let's merge it to have faster feedback to test ;)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

Could not process a file due to System error: Cannot rename

1 participant